Common - Add loading of dead units into vehicles#11372
Open
Dystopian wants to merge 11 commits into
Open
Conversation
Dystopian
marked this pull request as ready for review
July 21, 2026 15:04
Dystopian
commented
Jul 21, 2026
Dystopian
left a comment
Contributor
Author
There was a problem hiding this comment.
Works in RC 2.22.
Comment on lines
8
to
+10
| * 1: Distance <NUMBER> (default: 10) | ||
| * 2: Restricted to cargo only <BOOL> (default: false) | ||
| * 3: Override vehicle to check instead of distance search <OBJECT> (default: objNull) |
Contributor
Author
There was a problem hiding this comment.
Is it worth to move _overrideVehicle to the _distance and make one hybrid argument? When there is overriding vehicle, distance does not make sense anyway.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When merged this pull request will:
fnc_nearestVehiclesFreeSeat(ignore dead, locked, flipped, and simulation-disabled vehicles);distancechecks withfnc_getInteractionDistanceindraggingfunctions and reduce max load distance from 5 to 2.The implementation uses moveInAny. To target specific seats, temporary local units are spawned to probe seat positions.
The distance check was adjusted because the previous distance check made it difficult to load carried units into larger vehicles (e.g. trucks, aircraft).
moveInAnyhas a limitation for cargo seats: it places the unit into the seat with Position Number equal to the current number of cargo units, even if that seat is locked or already occupied.This implementation includes a workaround: it uses temporary units and
moveInCargoto shift themoveInAnyposition forward. However, it is not possible to shift it backwards. An approach based on pre-moveOutof units seems to be too buggy. As a result, in some cases loading into cargo may silently fail.The main problem with cargo is reported in https://feedback.bistudio.com/T198758 and fixed in DEV 2.21.153732. Revision e373abf can run only on DEV. 3438b34 can still be used in 2.20.
Feedback is welcome, especially on naming and comments.